package com.jz.community.moduleshopping.groupbuying.adapter;

import android.graphics.Color;
import android.support.annotation.Nullable;
import android.widget.TextView;

import com.amap.api.services.core.PoiItem;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jz.community.basecomm.utils.StringCommUtils;
import com.jz.community.moduleshopping.R;

import java.util.List;

public class EditAddressAdapter extends BaseQuickAdapter<PoiItem, BaseViewHolder> {


    private String keyword;

    public EditAddressAdapter(int layoutResId, @Nullable List<PoiItem> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, PoiItem item) {
        TextView tv_edit_address_title = helper.getView(R.id.tv_edit_address_title);
        tv_edit_address_title.setText(StringCommUtils.matcherSearchTitle(Color.parseColor("#ff9314"), item.getTitle(), keyword));
        TextView tv_edit_address_address = helper.getView(R.id.tv_edit_address_address);
        String add = item.getProvinceName() + item.getCityName() + item.getAdName() + item.getSnippet();
        tv_edit_address_address.setText(add);
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }
}
